package com.feihong.txgw.adapter.user;

import android.view.View;
import android.widget.TextView;

import com.adapter.base.BaseQuickAdapter;
import com.adapter.base.BaseViewHolder;
import com.adapter.base.animation.ScaleInAnimation;
import com.feihong.txgw.R;
import com.feihong.txgw.model.bean.integral.IntegralBackEntity;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName IntegralBackReAdapter
 * @package com.feihong.txgw.adapter.user
 * @data 2018/6/5 17:39
 * @Describe
 * @Change
 */
public class IntegralBackReAdapter extends BaseQuickAdapter<IntegralBackEntity.DataBean.PageListBean,BaseViewHolder> {

    public IntegralBackReAdapter(int layoutResId) {
        super(layoutResId);
        openLoadAnimation(new ScaleInAnimation(0.8f));
        isFirstOnly(false);
    }

    @Override
    protected void convert(final BaseViewHolder helper, IntegralBackEntity.DataBean.PageListBean item) {

        helper.setText(R.id.integral_item_remark,item.getRemark());
        helper.setText(R.id.tv_content,item.getTitle());
        helper.setText(R.id.order_sn,item.getOrder_sn());
        helper.setText(R.id.add_time,item.getAdd_time());
        helper.setText(R.id.point_value,item.getPoint_value());
        helper.setText(R.id.use_point_tv,item.getUse_point());

        helper.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                TextView textView = helper.getView(R.id.integral_item_remark);
                if(textView.getVisibility() == View.VISIBLE){
                    textView.setVisibility(View.GONE);
                }else {
                    textView.setVisibility(View.VISIBLE);
                }
            }
        });
    }
}
